package com.gorilla.imitateStruts.action.impl;


import java.util.Iterator;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.gorilla.imitateStruts.action.Action;
import com.gorilla.imitateStruts.service.UserManagerService;



public class QueryUserAction implements Action {

	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
		String userName = request.getParameter("userName");
		UserManagerService userManager = new UserManagerService();
		List<String> userList = userManager.queryUser(userName);
		for (Iterator<String> itor = userList.iterator();itor.hasNext();){
			String user = itor.next();
			System.out.println(user);
		}
		return "jsp/querySuccess.jsp";
	}

}
